
package com.weido.controller;

import com.weido.domain.User;
import com.weido.nettyServer.annotation.Path;
import com.weido.nettyServer.annotation.RespJson;
import com.weido.nettyServer.core.WebContext;
import org.springframework.stereotype.Controller;

/**
 * Created by chenli on 2019/11/13.
 */
@Path("first")
@Controller
public class FirstServlet  {

    @Path("path")
    @RespJson
    public User doGet(String name,String age) {
        User  user=new User();
        user.setAge(Integer.parseInt(age));
        user.setUsername(name);
        return user;
    }

    @Path("welcome")
    @RespJson
    public String welcome(WebContext webContext) {
        return "欢迎您！";
    }
}

